package scjp.preparation.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBConnector {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String url = "jdbc:mysql://localhost:3306/";
		// we are connecting to the addressBook database we created earlier
		String database = "addressBook";
		// we login as "root" user with password "mysql123"
		String userName = "root";
		String password = "admin";
		try (Connection connection = DriverManager.getConnection
		(url + database, userName, password)){
		System.out.println("Database connection: Successful");
		} catch (Exception e) {
		System.out.println("Database connection: Failed");
		e.printStackTrace();
		}
	}

}
